<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


</head>

<body>


<div id="app">

    <h1 v-if="type==='A'">A</h1>
    <h1 v-else-if="type=='B'">B</h1>
    <h1 v-else>No</h1>

    <li v-for=" (item,index) in arr">
        {{ item.age }} + {{index}}
    </li>

</div>


<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var vue = new Vue({
        el: "#app",
        data: {
            type: 'A',
            arr: [
                {age: 20},
                {age: 24},
                {age: 30},
                {age: 40},
            ]
            // ok: true
        }
    })
</script>

</body>
</html>